<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2021/10/4
  Time: 17:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String path = request.getContextPath();%>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript">
        $(function (){
            $('#testfile').fileinput({
                language: 'zh',
                uploadUrl: '<%=path%>/file/upLoadFile1',
                showCaption: true,
                showUpload: true,
                showRemove: true,
                showClose: true,
                minFileSize:20,
                maxFileCount:3,
                enctype:"multiple-form/data",
                browseClass: 'btn btn-primary'
            });
            $('#testfile').on('fileuploaded',function (event,data,previewId,index){
                //data 有很多数据 例如 imgUrl就在里面保存
                var dataUrl = $("#imgUrl").val();
                var url=  dataUrl+','+data.response.imgUrl;
                $("#imgUrl").val(url.substring(1));

            })
        })
        $(function (){
            $('#testfile1').fileinput({
                language: 'zh',
                uploadUrl: '<%=path%>/file/upLoadFile2',
                showCaption: true,
                showUpload: true,
                showRemove: true,
                showClose: true,
                minFileSize:20,
                maxFileCount:3,
                enctype:"multiple-form/data",
                browseClass: 'btn btn-primary'
            });
            $('#testfile1').on('fileuploaded',function (event,data,previewId,index){
                //data 有很多数据 例如 imgUrl就在里面保存
                var dataUrl = $("#imgUrl1").val();
                var url=  dataUrl+','+data.response.imgUrl;
                $("#imgUrl1").val(url.substring(1));

            })
        })

    </script>
</head>
<body>
<form id="tabRouteImg_update_form">
    <input type="hidden" name="rgid" value="${tabRouteImg.rgid}"><br>
    <input type="hidden" name="rid" value="${tabRouteImg.rid}"><br>
    <div class="form-group">
        <label for="testfile"> 大图片:</label>
        <input id="imgUrl" type="text" name="bigpic">
        <input type="file" class="form-control" name="myFile" id="testfile" placeholder="添加图片">
        <img src="<%=path%>/file/download?filename=${tabRouteImg.bigpic}" width="50px" height="50px">

    </div>
    <div class="form-group">
        <label for="testfile">小图片:</label>
        <input id="imgUrl1" type="text" name="smallpic">
        <input type="file" class="form-control" name="myFile" id="testfile1" placeholder="添加图片">
        <img src="<%=path%>/file/download?filename=${tabRouteImg.smallpic}" width="50px" height="50px">

    </div>
</form>
</body>
</html>
